<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <img id="img" style="width:500px;height: auto;">
    <script>
        let img = document.querySelector("#img");

        let arr = [
            "https://pics2.baidu.com/feed/b21bb051f8198618d1c89f36475bfd758ad4e636.jpeg?token=e2a481ac6d006bd2cb27a387b1def13c",
            "https://img1.baidu.com/it/u=1674160186,626942858&fm=253&fmt=auto&app=120&f=JPEG?w=1132&h=800",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.jj20.com%2Fup%2Fallimg%2F611%2F042613114934%2F130426114934-17.jpg&refer=http%3A%2F%2Fpic.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651990304&t=a97c12bdb992e9071f6e2d6dd2234a4b",
            "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.jj20.com%2Fup%2Fallimg%2F711%2F112Q3150326%2F13112Q50326-5.jpg&refer=http%3A%2F%2Fpic.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651990334&t=525e2913936fd4c6f974e6e88df3d1a4",
        ]

        let index = 0;

        setInterval(function() {
            img.src = arr[index ++];
            if (index >= arr.length) {
                index = 0;
            }

        },500)
    </script>
</body>
</html>